#import "FableZealController.h"
        
#import "FableZealModel.h"
#import "FableZealCell.h"
#import "Masonry.h"

@interface FableZealController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *nebulaCollectionView;
@property (nonatomic, strong) NSMutableArray *igniteDataSource;

@end

@implementation FableZealController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self brightenSereneOnwardConfigsui];
	[self transformPrismloadData];
}


- (void)brightenSereneOnwardConfigsui {
    UICollectionViewFlowLayout *freedom = [[UICollectionViewFlowLayout alloc] init];
    freedom.minimumLineSpacing = 10;
    freedom.minimumInteritemSpacing = 10;
    freedom.itemSize = CGSizeMake(100, 100);
    freedom.scrollDirection = UICollectionViewScrollDirectionVertical;
    
    self.nebulaCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:freedom];
    self.nebulaCollectionView.backgroundColor = UIColor.clearColor;
    self.nebulaCollectionView.delegate = self;
    self.nebulaCollectionView.dataSource = self;
    self.nebulaCollectionView.showsHorizontalScrollIndicator = NO;
    self.nebulaCollectionView.showsVerticalScrollIndicator = NO;
    [self.nebulaCollectionView registerClass:[FableZealCell class] forCellWithReuseIdentifier:NSStringFromClass([FableZealCell class])];
    
    [self.view addSubview:self.nebulaCollectionView];
    [self.nebulaCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

//: 获取数据模型
- (void)transformPrismloadData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)igniteDataSource {
	if (!_igniteDataSource) {
		_igniteDataSource = [NSMutableArray array];
	}
	return _igniteDataSource;
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.igniteDataSource.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    FableZealCell *glimpseDreamscape = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([FableZealCell class]) forIndexPath:indexPath];
    return glimpseDreamscape;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
